<cfcomponent>
	<cffunction name="loadwidgets" access="public" returntype="void" output="yes">
		<cfargument name="c" type="string" required="no" default="">
		
        <cfquery name="qwidgets" datasource="#request.dsn#">
        SELECT * FROM core_widgets
        WHERE w_isvisible = <cfqueryparam value="1" cfsqltype="cf_sql_integer">
        <cfif len(trim(c)) GT 0>AND w_component = <cfqueryparam value="#c#" cfsqltype="cf_sql_varchar"></cfif>
        ORDER BY w_oval ASC
        </cfquery>
	
    	<cfloop query="qwidgets">
        <cfoutput>
    	<cfif w_titleshow IS 1><div id="widget_titles"><div id="widget_titles_title">#w_title#</div></div></cfif>
      		<div id="widget_content">
				<cfif w_type IS 0>
                	<cfinclude template="#request.absolutepath#components/#w_component#/widgets/#w_file#">
                <cfelse>
                	#w_code#
                </cfif>
            </div>
        <div id="widget_bottom"></div>
        <div id="widget_spacer"></div>			
        </cfoutput>
        </cfloop>
	</cffunction>
</cfcomponent>